
const Service = require('../../../core/service/ApiService');

class UserDao extends Service{

    //家长端
    async findInfoByPhone(account) {
        return this.model.InfoParents.findOne({
            where:{
                parent_mobile:account,
                status:this.constant.PARENT_STATUS.ENABLE
            },
            arguments:['parent_id','parent_mobile','child_number','pwd']
        })
    }

    async findInfoByNumber(number) {
        return this.model.InfoParents.findOne({
            where:{
                child_number:number,
                status:this.constant.PARENT_STATUS.ENABLE
            },
            arguments:['parent_id','parent_mobile','child_number','pwd']
        })
    }

    async findStudentNameByNumber(number){
        return this.model.InfoStudents.findOne({
            where:{
                number:number,
                status:this.constant.STUDENT_STATUS.ENABLE

            },
            arguments:['number','name']
        })
    }

}

module.exports = UserDao;
